home *** CD-ROM | disk | FTP | other *** search
/ The Utilities Experience / The Utilities Experience - Volume 1.iso / software / misc / o-z / x-windows / mesa-amiwin / src / gamma.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-18  |  1.2 KB  |  49 lines

  1. /* $Id$ */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  1.2
  6.  * Copyright (C) 1995  Brian Paul  (brianp@ssec.wisc.edu)
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23.  
  24. /*
  25. $Log$
  26.  */
  27.  
  28.  
  29.  
  30.  
  31. #include "context.h"
  32.  
  33.  
  34.  
  35. /*
  36.  * Apply gamma correction to an array of RGB pixels.
  37.  */
  38. void
  39. gl_apply_gamma( GLuint n, GLubyte red[], GLubyte green[], GLubyte blue[] )
  40. {
  41.    GLuint i;
  42.  
  43.    for (i=0;i<n;i++) {
  44.       red[i]   = CC.RedRamp[red[i]];
  45.       green[i] = CC.GreenRamp[green[i]];
  46.       blue[i]  = CC.BlueRamp[blue[i]];
  47.    }
  48. }
  49.